[Android] Restore OnBackButtonPressed interception support when using OnBackPressedDispatcher #35154
[Android] Restore OnBackButtonPressed interception support when using OnBackPressedDispatcher #35154Dhivya-SF4094 wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates Android back navigation handling in MauiAppCompatActivity to restore reliable OnBackButtonPressed interception when using AndroidX OnBackPressedDispatcher, avoiding deprecated/dual-path back handling and adding a regression UI test.
Changes:
- Register a single AndroidX
OnBackPressedCallback(all API levels) and route back handling through MAUI lifecycle events. - Remove the deprecated
OnBackPressed()override and adjustHandleBackNavigation()to return whether MAUI handled the back press. - Add Issue #8680 HostApp page + UI test, and adjust Shell toolbar back handling to use Shell’s back-press pipeline.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txt | Records removal of OnBackPressed/OnDestroy overrides from the public API surface (but introduces a BOM inconsistency). |
| src/Core/src/Platform/Android/MauiAppCompatActivity.cs | Registers MauiOnBackPressedCallback on OnBackPressedDispatcher and removes predictive-back callback plumbing. |
| src/Core/src/Platform/Android/MauiAppCompatActivity.Lifecycle.cs | Removes OnBackPressed() override and changes HandleBackNavigation() to return a boolean. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8680.cs | Adds a regression UI test for intercepting back navigation (but currently gated incorrectly and doesn’t simulate device back). |
| src/Controls/tests/TestCases.HostApp/Issues/Issue8680.cs | Adds the HostApp reproduction page for Issue #8680 (needs formatting cleanup). |
| src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cs | Routes toolbar back through _shell.SendBackButtonPressed() instead of the current Page directly. |
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 7 findings
See inline comments for details.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 6 findings
See inline comments for details.
Test Failure Review
❔ Test Failure Review -
|
| Failure | Verdict | Evidence |
|---|---|---|
| Build Analysis | Insufficient data | The check is marked failed, but the context provides only the Build Analysis documentation link and no build-analysis matches, timeline issues, or log excerpts. |
maui-pr-devicetests build 1428613 |
Insufficient data | The rollup and Android CoreCLR, Android Mono, MacCatalyst Mono, Windows device-test build, and iOS Mono child checks failed, but build 1428613 was inaccessible with 404 (Not Found); failedRecords, logExcerpts, testResults, and Helix summaries are empty, so hidden device-test failures could not be verified. |
maui-pr-uitests build 1428612 |
Insufficient data | The rollup and sample-app build child checks failed, but build 1428612 was inaccessible with 404 (Not Found); no timeline records, logs, test results, or distinct extracted failures were available. |
Recommended action
Regather the review context when builds 1428612 and 1428613 are accessible, then inspect the failed timelines/logs and Helix aggregate data before attributing these failures to the PR.
Evidence details
PR #35154 targets inflight/current from fix-8680 at a42e2f99997da32392b4bc9c76a8e8c9c29ddc7a. Labels and scope point to platform/android and area-navigation; inferred platform from changed files is android.
Changed files are src/Core/src/Platform/Android/MauiAppCompatActivity.Lifecycle.cs, src/Core/src/Platform/Android/MauiAppCompatActivity.cs, src/Controls/tests/TestCases.HostApp/Issues/Issue8680.cs, and src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue8680.cs.
The gathered check rollup marks maui-pr build 1420508 successful. The failing or inconclusive checks are Build Analysis, maui-pr-devicetests, device-test child checks for Android CoreCLR, Android Mono, MacCatalyst Mono, Windows device-test build, iOS Mono, maui-pr-uitests, and UI sample-app build child checks.
Build 1428613 and build 1428612 both have accessible: false with error Response status code does not indicate success: 404 (Not Found). For both builds, failedRecords, timelineIssues, logExcerpts, testFailuresFromLogs, testResults, and recentBaseBuilds are empty. For device-test build 1428613, helix.checked is false, helix.jobIds is empty, and helix.summaries is empty.
No distinct test failures were extracted from accessible AzDO logs or test results. The context limitation notes that authenticated AzDO access used an Azure CLI bearer token for local-only data gathering, while the gh-aw workflow relies on public build/timeline/log APIs unless AZDO_TOKEN is provided by the runner environment.
…net#34527) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ### Issue Details: Horizontalspacing / Verticalspacing is not not applied to the first column in GridItemLayout using CollectionView on Android platform. ### Root Cause: The grid spacing was not being distributed symmetrically across the active layout implementations, so edge items did not fully participate when spacing changed at runtime. ### Description of Change: - On Android, the fix in MauiRecyclerView.cs changes how RecyclerView padding is handled for GridItemsLayout. Android was already using SpacingItemDecoration, which applies half-spacing on all four sides of each item. Previously, negative RecyclerView padding canceled that spacing at the control edges. The branch keeps that negative-padding behavior for non-grid layouts, but disables it for GridItemsLayout, allowing the grid’s half-spacing to remain visible at the outer perimeter. This makes the first row and first column visually respond when spacing changes, but it also changes the grid behavior from spacing only between items to spacing around the outside edges as well. **Tested the behavior in the following platforms:** - [x] Android - [x] Windows - [ ] iOS - [ ] Mac ### Reference: N/A ### Issues Fixed: Fixes dotnet#34257 ### Screenshots | Before | After | |---------|--------| | <Video src="https://github.com/user-attachments/assets/578dda69-1d60-474c-a6d8-23b3f9d29a50" Width="300" Height="600"> | <Video src="https://github.com/user-attachments/assets/7f3826e6-5922-4b6f-a6b9-de581b7db6c3" Width="300" Height="600"> |
…ing ToPlatform and subsequent property changes (dotnet#31159) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- !!!!!!! MAIN IS THE ONLY ACTIVE BRANCH. MAKE SURE THIS PR IS TARGETING MAIN. !!!!!!! --> - The iOS Label performance was improved in PR dotnet#30864. In that PR, the Label and Entry Feature Matrix test sample and script were modified, which caused discrepancies in the expected images due to changes which is due to test sample's default property values. In this PR, I updated the test sample and re-saved the images accordingly. - Windows - The Entry is now unfocused, so I re-saved the latest image. - Android - I modified the test sample by altering the default values and re-saved two images. Additionally, while working on the test sample changes, I identified and fixed issues in FormattedStringExtensions. These updates improve formatted text rendering on iOS by correctly propagating span properties (font, character spacing, and line-break settings) from the label to each span. The layout logic is also more robust, falling back to MAUI’s calculated size when iOS has not yet provided a valid label size, preventing incorrect text positioning and rendering issues. <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Contributing to dotnet#30864 --------- Co-authored-by: KarthikRajaKalaimani <92777139+KarthikRajaKalaimani@users.noreply.github.com> Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com> Co-authored-by: albyrock87 <albyrock87@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Appears to be unused, but trips up analyzers when investigating other issues. Fixes: xamarin/Xamarin.Forms#1749 ---------
🔍 Skill Validation Results✅ Static Checks PassedSkills checked: 18 | Agents checked: 4 Full validator output⏭️ LLM Evaluation: SkippedNo changed skills with eval tests found. |
|
/review -b feature/enhanced-reviewer |
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@Dhivya-SF4094 — new AI review results are available based on this last commit:
b8e4f6c.
Reverted script file changes To request a fresh review after new comments or commits, comment/review rerun.
Review Sessions — click to expand
Gate — Test Before & After Fix
Gate Result: ❌ FAILED
Platform: ANDROID · Base: main · Merge base: e904e900
🩺 Fix does not compile — applying the PR's fix produces a build error before tests can run. The earlier-than-test failure is the root cause; the per-test ❌ FAIL marks are downstream effects, not real test failures.
| Test | Without Fix (expect FAIL) | With Fix (expect PASS) |
|---|---|---|
🖥️ Issue8680 Issue8680 |
🛠️ BUILD ERROR | 🛠️ BUILD ERROR |
🔴 Without fix — 🖥️ Issue8680: 🛠️ BUILD ERROR · 1298s
Determining projects to restore...
Restored /home/vsts/work/1/s/src/Graphics/src/Graphics/Graphics.csproj (in 528 ms).
Restored /home/vsts/work/1/s/src/Essentials/src/Essentials.csproj (in 4.05 sec).
Restored /home/vsts/work/1/s/src/Core/src/Core.csproj (in 5.74 sec).
Restored /home/vsts/work/1/s/src/Core/maps/src/Maps.csproj (in 2.87 sec).
Restored /home/vsts/work/1/s/src/Controls/src/Xaml/Controls.Xaml.csproj (in 79 ms).
Restored /home/vsts/work/1/s/src/Controls/src/Core/Controls.Core.csproj (in 67 ms).
Restored /home/vsts/work/1/s/src/Controls/Maps/src/Controls.Maps.csproj (in 54 ms).
Restored /home/vsts/work/1/s/src/Controls/Foldable/src/Controls.Foldable.csproj (in 620 ms).
Restored /home/vsts/work/1/s/src/BlazorWebView/src/Maui/Microsoft.AspNetCore.Components.WebView.Maui.csproj (in 71 ms).
Restored /home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj (in 1.83 sec).
1 of 11 projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(48,21): error CS1061: 'ScrollView' does not contain a definition for 'Row' and no accessible extension method 'Row' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
Build FAILED.
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(48,21): error CS1061: 'ScrollView' does not contain a definition for 'Row' and no accessible extension method 'Row' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
0 Warning(s)
2 Error(s)
Time Elapsed 00:06:23.21
* daemon not running; starting now at tcp:5037
* daemon started successfully
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(48,21): error CS1061: 'ScrollView' does not contain a definition for 'Row' and no accessible extension method 'Row' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
Build FAILED.
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(48,21): error CS1061: 'ScrollView' does not contain a definition for 'Row' and no accessible extension method 'Row' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
0 Warning(s)
2 Error(s)
Time Elapsed 00:06:48.60
* daemon not running; starting now at tcp:5037
* daemon started successfully
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Core -> /home/vsts/work/1/s/artifacts/bin/Core/Debug/net10.0-android36.0/Microsoft.Maui.dll
Controls.BindingSourceGen -> /home/vsts/work/1/s/artifacts/bin/Controls.BindingSourceGen/Debug/netstandard2.0/Microsoft.Maui.Controls.BindingSourceGen.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Maps -> /home/vsts/work/1/s/artifacts/bin/Maps/Debug/net10.0-android36.0/Microsoft.Maui.Maps.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Controls.Core -> /home/vsts/work/1/s/artifacts/bin/Controls.Core/Debug/net10.0-android36.0/Microsoft.Maui.Controls.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Controls.Xaml -> /home/vsts/work/1/s/artifacts/bin/Controls.Xaml/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Xaml.dll
Microsoft.AspNetCore.Components.WebView.Maui -> /home/vsts/work/1/s/artifacts/bin/Microsoft.AspNetCore.Components.WebView.Maui/Debug/net10.0-android36.0/Microsoft.AspNetCore.Components.WebView.Maui.dll
Controls.Foldable -> /home/vsts/work/1/s/artifacts/bin/Controls.Foldable/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Foldable.dll
Controls.Maps -> /home/vsts/work/1/s/artifacts/bin/Controls.Maps/Debug/net10.0-android36.0/Microsoft.Maui.Controls.Maps.dll
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(48,21): error CS1061: 'ScrollView' does not contain a definition for 'Row' and no accessible extension method 'Row' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
Build FAILED.
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accepting a first argument of type 'Label' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(48,21): error CS1061: 'ScrollView' does not contain a definition for 'Row' and no accessible extension method 'Row' accepting a first argument of type 'ScrollView' could be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Controls.TestCases.HostApp.csproj::TargetFramework=net10.0-android]
0 Warning(s)
2 Error(s)
Time Elapsed 00:06:37.01
🟢 With fix — 🖥️ Issue8680: 🛠️ BUILD ERROR · 379s
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
/home/vsts/work/1/s/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt(2517,1): error RS0017: Symbol 'override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/home/vsts/work/1/s/src/Core/src/Core.csproj::TargetFramework=net10.0-android36.0]
Build FAILED.
/home/vsts/work/1/s/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt(2517,1): error RS0017: Symbol 'override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/home/vsts/work/1/s/src/Core/src/Core.csproj::TargetFramework=net10.0-android36.0]
0 Warning(s)
1 Error(s)
Time Elapsed 00:01:39.36
* daemon not running; starting now at tcp:5037
* daemon started successfully
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
/home/vsts/work/1/s/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt(2517,1): error RS0017: Symbol 'override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/home/vsts/work/1/s/src/Core/src/Core.csproj::TargetFramework=net10.0-android36.0]
Build FAILED.
/home/vsts/work/1/s/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt(2517,1): error RS0017: Symbol 'override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/home/vsts/work/1/s/src/Core/src/Core.csproj::TargetFramework=net10.0-android36.0]
0 Warning(s)
1 Error(s)
Time Elapsed 00:01:40.74
* daemon not running; starting now at tcp:5037
* daemon started successfully
Determining projects to restore...
All projects are up-to-date for restore.
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Graphics -> /home/vsts/work/1/s/artifacts/bin/Graphics/Debug/net10.0-android36.0/Microsoft.Maui.Graphics.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
Essentials -> /home/vsts/work/1/s/artifacts/bin/Essentials/Debug/net10.0-android36.0/Microsoft.Maui.Essentials.dll
##vso[build.updatebuildnumber]10.0.80-ci+azdo.14293293
/home/vsts/work/1/s/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt(2517,1): error RS0017: Symbol 'override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/home/vsts/work/1/s/src/Core/src/Core.csproj::TargetFramework=net10.0-android36.0]
Build FAILED.
/home/vsts/work/1/s/src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt(2517,1): error RS0017: Symbol 'override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void' is part of the declared API, but is either not public or could not be found (https://github.com/dotnet/roslyn/blob/main/src/RoslynAnalyzers/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/home/vsts/work/1/s/src/Core/src/Core.csproj::TargetFramework=net10.0-android36.0]
0 Warning(s)
1 Error(s)
Time Elapsed 00:01:15.80
⚠️ Failure Details
- 🛠️ Issue8680 without fix: build failed before tests could run
/home/vsts/work/1/s/src/Controls/tests/TestCases.HostApp/Issues/Issue7814.cs(45,30): error CS1061: 'Label' does not contain a definition for 'Column' and no accessible extension method 'Column' accept...
- 🛠️ Issue8680 with fix: build failed (fix does not compile)
📁 Fix files reverted (264 files)
eng/Signing.propseng/Versions.propseng/devices/run-windows-devicetests.cmdeng/devices/windows.cakeeng/pipelines/ci-copilot.ymleng/pipelines/common/ui-tests-steps.ymleng/pipelines/common/ui-tests.ymlsrc/BlazorWebView/src/Maui/Android/BlazorAndroidWebView.cssrc/BlazorWebView/src/Maui/Android/BlazorWebViewHandler.Android.cssrc/BlazorWebView/src/Maui/Android/WebKitWebViewClient.cssrc/Compatibility/Core/src/Android/CollectionView/TemplatedItemViewHolder.cssrc/Compatibility/Core/src/Android/Renderers/SwipeViewRenderer.cssrc/Compatibility/Core/src/MacOS/Extensions/NSMenuExtensions.cssrc/Compatibility/Core/src/Windows/CollectionView/ItemContentControl.cssrc/Compatibility/Core/src/iOS/CollectionView/TemplatedCell.cssrc/Compatibility/Core/src/iOS/EventTracker.cssrc/Compatibility/Core/src/iOS/Renderers/SwipeViewRenderer.cssrc/Compatibility/Core/src/iOS/Renderers/UIContainerCell.cssrc/Controls/src/Build.Tasks/SetPropertiesVisitor.cssrc/Controls/src/Core/ActionSheetArguments.cssrc/Controls/src/Core/AlertArguments.cssrc/Controls/src/Core/BindableObject.cssrc/Controls/src/Core/Border/Border.cssrc/Controls/src/Core/Button/Button.iOS.cssrc/Controls/src/Core/Compatibility/Android/Resources/layout/flyoutcontent.axmlsrc/Controls/src/Core/Compatibility/Handlers/FlyoutPage/iOS/PhoneFlyoutPageRenderer.cssrc/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/Android/SearchHandlerAppearanceTracker.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutRecyclerAdapter.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFlyoutTemplatedContentRenderer.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellFragmentStateAdapter.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellItemRenderer.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellRenderer.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellSectionRenderer.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/iOS/SearchHandlerAppearanceTracker.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellPageRendererTracker.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellRenderer.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRenderer.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRootRenderer.cssrc/Controls/src/Core/Compatibility/Handlers/Shell/iOS/UIContainerCell.cssrc/Controls/src/Core/Compatibility/Handlers/TabbedPage/iOS/TabbedRenderer.cssrc/Controls/src/Core/ContentPage/ContentPage.cssrc/Controls/src/Core/ContentView/ContentView.cssrc/Controls/src/Core/Editor/Editor.Mapper.cssrc/Controls/src/Core/Editor/Editor.iOS.cssrc/Controls/src/Core/Element/Element.cssrc/Controls/src/Core/Entry/Entry.Mapper.cssrc/Controls/src/Core/Entry/Entry.iOS.cssrc/Controls/src/Core/FlyoutPage/FlyoutPage.cssrc/Controls/src/Core/FormattedString.cssrc/Controls/src/Core/GestureElement.cssrc/Controls/src/Core/Handlers/Items/Android/Adapters/EmptyViewAdapter.cssrc/Controls/src/Core/Handlers/Items/Android/Adapters/GroupableItemsViewAdapter.cssrc/Controls/src/Core/Handlers/Items/Android/Adapters/ItemsViewAdapter.cssrc/Controls/src/Core/Handlers/Items/Android/ItemContentView.cssrc/Controls/src/Core/Handlers/Items/Android/MauiCarouselRecyclerView.cssrc/Controls/src/Core/Handlers/Items/Android/MauiRecyclerView.cssrc/Controls/src/Core/Handlers/Items/Android/SimpleViewHolder.cssrc/Controls/src/Core/Handlers/Items/Android/SizedItemContentView.cssrc/Controls/src/Core/Handlers/Items/Android/TemplatedItemViewHolder.cssrc/Controls/src/Core/Handlers/Items/CarouselViewHandler.Android.cssrc/Controls/src/Core/Handlers/Items/CarouselViewHandler.Windows.cssrc/Controls/src/Core/Handlers/Items/CarouselViewHandler.cssrc/Controls/src/Core/Handlers/Items/ItemsViewHandler.cssrc/Controls/src/Core/Handlers/Items/ItemsViewHandler.iOS.cssrc/Controls/src/Core/Handlers/Items/StructuredItemsViewHandler.Android.cssrc/Controls/src/Core/Handlers/Items/Tizen/ItemTemplateAdaptor.cssrc/Controls/src/Core/Handlers/Items/iOS/CarouselViewController.cssrc/Controls/src/Core/Handlers/Items/iOS/ItemsViewController.cssrc/Controls/src/Core/Handlers/Items/iOS/SelectableItemsViewController.cssrc/Controls/src/Core/Handlers/Items/iOS/TemplatedCell.cssrc/Controls/src/Core/Handlers/Items2/CarouselViewHandler2.iOS.cssrc/Controls/src/Core/Handlers/Items2/ItemsViewHandler2.iOS.cssrc/Controls/src/Core/Handlers/Items2/iOS/CarouselViewController2.cssrc/Controls/src/Core/Handlers/Items2/iOS/GroupableItemsViewController2.cssrc/Controls/src/Core/Handlers/Items2/iOS/ItemsViewController2.cssrc/Controls/src/Core/Handlers/Items2/iOS/LayoutFactory2.cssrc/Controls/src/Core/Handlers/Items2/iOS/SelectableItemsViewController2.cssrc/Controls/src/Core/Handlers/Items2/iOS/StructuredItemsViewController2.cssrc/Controls/src/Core/Handlers/Items2/iOS/TemplatedCell2.cssrc/Controls/src/Core/Handlers/Shapes/Polygon/PolygonHandler.Android.cssrc/Controls/src/Core/Handlers/Shapes/Polygon/PolygonHandler.Tizen.cssrc/Controls/src/Core/Handlers/Shapes/Polygon/PolygonHandler.Windows.cssrc/Controls/src/Core/Handlers/Shapes/Polygon/PolygonHandler.cssrc/Controls/src/Core/Handlers/Shapes/Polygon/PolygonHandler.iOS.cssrc/Controls/src/Core/Handlers/Shapes/Polyline/PolylineHandler.Android.cssrc/Controls/src/Core/Handlers/Shapes/Polyline/PolylineHandler.Tizen.cssrc/Controls/src/Core/Handlers/Shapes/Polyline/PolylineHandler.Windows.cssrc/Controls/src/Core/Handlers/Shapes/Polyline/PolylineHandler.cssrc/Controls/src/Core/Handlers/Shapes/Polyline/PolylineHandler.iOS.cssrc/Controls/src/Core/Handlers/Shell/ShellHandler.Windows.cssrc/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cssrc/Controls/src/Core/Handlers/Shell/ShellSectionHandler.Windows.cssrc/Controls/src/Core/Handlers/Shell/Windows/ShellFlyoutItemView.cssrc/Controls/src/Core/Handlers/Shell/Windows/ShellView.cssrc/Controls/src/Core/Hosting/AppHostBuilderExtensions.cssrc/Controls/src/Core/ImageElement.cssrc/Controls/src/Core/IndicatorView/IndicatorStackLayout.cssrc/Controls/src/Core/InputView/InputView.cssrc/Controls/src/Core/Internals/WeakEventProxy.cssrc/Controls/src/Core/Items/SelectionList.cssrc/Controls/src/Core/Label/Label.Mapper.cssrc/Controls/src/Core/Label/Label.cssrc/Controls/src/Core/Label/Label.iOS.cssrc/Controls/src/Core/Layout/Layout.cssrc/Controls/src/Core/ListView/ListView.cssrc/Controls/src/Core/NavigationPage/NavigationPage.cssrc/Controls/src/Core/NavigationPage/NavigationPageToolbar.cssrc/Controls/src/Core/Page/Page.cssrc/Controls/src/Core/Picker/Picker.cssrc/Controls/src/Core/Platform/AlertManager/AlertManager.cssrc/Controls/src/Core/Platform/Android/DragAndDropGestureHandler.cssrc/Controls/src/Core/Platform/Android/Extensions/ToolbarExtensions.cssrc/Controls/src/Core/Platform/Android/GenericAnimatorListener.cssrc/Controls/src/Core/Platform/Android/TabbedPageManager.cssrc/Controls/src/Core/Platform/GestureManager/GesturePlatformManager.iOS.cssrc/Controls/src/Core/Platform/Windows/CollectionView/ItemContentControl.cssrc/Controls/src/Core/Platform/Windows/CollectionView/ScrollHelpers.cssrc/Controls/src/Core/Platform/iOS/Extensions/FormattedStringExtensions.cssrc/Controls/src/Core/PromptArguments.cssrc/Controls/src/Core/PublicAPI/net-android/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/net-ios/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/net-tizen/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/net-windows/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/net/PublicAPI.Unshipped.txtsrc/Controls/src/Core/PublicAPI/netstandard/PublicAPI.Unshipped.txtsrc/Controls/src/Core/RadioButton/RadioButton.cssrc/Controls/src/Core/ResourcesExtensions.cssrc/Controls/src/Core/ScrollView/ScrollView.cssrc/Controls/src/Core/Setter.cssrc/Controls/src/Core/Shell/Shell.cssrc/Controls/src/Core/Shell/ShellNavigationManager.cssrc/Controls/src/Core/Shell/ShellSection.cssrc/Controls/src/Core/SwipeView/SwipeItem.cssrc/Controls/src/Core/SwipeView/SwipeItemView.cssrc/Controls/src/Core/SwipeView/SwipeItems.cssrc/Controls/src/Core/SwipeView/SwipeView.cssrc/Controls/src/Core/Toolbar/Toolbar.Android.cssrc/Controls/src/Core/VisualElement/VisualElement.cssrc/Controls/src/Core/VisualStateManager.cssrc/Controls/src/Core/WebView/WebViewSource.cssrc/Controls/src/Core/Window/Window.Android.cssrc/Controls/src/Core/Window/Window.cssrc/Controls/src/SourceGen/NodeSGExtensions.cssrc/Core/AndroidNative/maui/src/main/java/com/microsoft/maui/PlatformWrapperView.javasrc/Core/maps/src/Handlers/Map/MapHandler.Android.cssrc/Core/maps/src/Handlers/Map/MapHandler.iOS.cssrc/Core/maps/src/Platform/iOS/MauiMKMapView.cssrc/Core/src/Animations/AnimationManager.cssrc/Core/src/Core/IMauiRecyclerView.cssrc/Core/src/Core/ISafeAreaView2.cssrc/Core/src/Diagnostics/DiagnosticsManager.cssrc/Core/src/Diagnostics/IDiagnosticsManager.cssrc/Core/src/Diagnostics/Instrumentation/DiagnosticInstrumentation.cssrc/Core/src/Diagnostics/Instrumentation/LayoutArrangeInstrumentation.cssrc/Core/src/Diagnostics/Instrumentation/LayoutDiagnosticMetrics.cssrc/Core/src/Diagnostics/Instrumentation/LayoutMeasureInstrumentation.cssrc/Core/src/Graphics/MauiDrawable.Android.cssrc/Core/src/Handlers/Button/ButtonHandler.cssrc/Core/src/Handlers/Button/ButtonHandler.iOS.cssrc/Core/src/Handlers/DatePicker/DatePickerHandler.Android.cssrc/Core/src/Handlers/DatePicker/DatePickerHandler.MacCatalyst.cssrc/Core/src/Handlers/Editor/EditorHandler.iOS.cssrc/Core/src/Handlers/Entry/EntryHandler.cssrc/Core/src/Handlers/Entry/EntryHandler.iOS.cssrc/Core/src/Handlers/FlyoutView/FlyoutViewHandler.Android.cssrc/Core/src/Handlers/HybridWebView/HybridWebViewHandler.Windows.cssrc/Core/src/Handlers/Image/ImageHandler.Windows.cssrc/Core/src/Handlers/Image/ImageHandler.iOS.cssrc/Core/src/Handlers/Label/LabelHandler.cssrc/Core/src/Handlers/Label/LabelHandler.iOS.cssrc/Core/src/Handlers/Picker/PickerHandler.Windows.cssrc/Core/src/Handlers/Picker/PickerHandler.iOS.cssrc/Core/src/Handlers/ProgressBar/ProgressBarHandler.iOS.cssrc/Core/src/Handlers/RefreshView/RefreshViewHandler.Windows.cssrc/Core/src/Handlers/ScrollView/ScrollViewHandler.Android.cssrc/Core/src/Handlers/ScrollView/ScrollViewHandler.Windows.cssrc/Core/src/Handlers/ScrollView/ScrollViewHandler.iOS.cssrc/Core/src/Handlers/SearchBar/SearchBarHandler.iOS.cssrc/Core/src/Handlers/SearchBar/SearchBarHandler2.Android.cssrc/Core/src/Handlers/Stepper/StepperHandler.iOS.cssrc/Core/src/Handlers/SwipeItemMenuItem/SwipeItemMenuItemHandler.Android.cssrc/Core/src/Handlers/SwipeItemMenuItem/SwipeItemMenuItemHandler.Windows.cssrc/Core/src/Handlers/SwipeItemMenuItem/SwipeItemMenuItemHandler.cssrc/Core/src/Handlers/SwipeItemMenuItem/SwipeItemMenuItemHandler.iOS.cssrc/Core/src/Handlers/Switch/SwitchHandler.iOS.cssrc/Core/src/Handlers/View/ViewHandler.cssrc/Core/src/Handlers/WebView/WebViewHandler.Android.cssrc/Core/src/Handlers/Window/WindowHandler.Windows.cssrc/Core/src/Hosting/LifecycleEvents/AppHostBuilderExtensions.Android.cssrc/Core/src/ImageSources/FontImageSourceService/FontImageSourceService.Windows.cssrc/Core/src/Layouts/Flex.cssrc/Core/src/Platform/Android/ActivityIndicatorExtensions.cssrc/Core/src/Platform/Android/ActivityResultCallbackRegistry.cssrc/Core/src/Platform/Android/BorderDrawable.cssrc/Core/src/Platform/Android/ContentViewGroup.cssrc/Core/src/Platform/Android/EditTextExtensions.cssrc/Core/src/Platform/Android/LayoutViewGroup.cssrc/Core/src/Platform/Android/MauiAppCompatActivity.Lifecycle.cssrc/Core/src/Platform/Android/MauiAppCompatActivity.cssrc/Core/src/Platform/Android/MauiHybridWebView.cssrc/Core/src/Platform/Android/MauiHybridWebViewClient.cssrc/Core/src/Platform/Android/MauiScrollView.cssrc/Core/src/Platform/Android/MauiSearchView.cssrc/Core/src/Platform/Android/MauiSwipeRefreshLayout.cssrc/Core/src/Platform/Android/MauiSwipeView.cssrc/Core/src/Platform/Android/MauiWebView.cssrc/Core/src/Platform/Android/MauiWebViewClient.cssrc/Core/src/Platform/Android/MauiWindowInsetListener.cssrc/Core/src/Platform/Android/Navigation/NavigationRootManager.cssrc/Core/src/Platform/Android/RadioButtonExtensions.cssrc/Core/src/Platform/Android/SafeAreaExtensions.cssrc/Core/src/Platform/Android/SearchViewExtensions.cssrc/Core/src/Platform/Android/SemanticExtensions.cssrc/Core/src/Platform/Android/TextViewExtensions.cssrc/Core/src/Platform/Android/ViewExtensions.cssrc/Core/src/Platform/Android/WrapperView.cssrc/Core/src/Platform/Windows/ContentPanel.cssrc/Core/src/Platform/Windows/LayoutPanel.cssrc/Core/src/Platform/Windows/PickerExtensions.cssrc/Core/src/Platform/Windows/RadioButtonExtensions.cssrc/Core/src/Platform/Windows/Styles/MauiComboBoxStyle.xamlsrc/Core/src/Platform/Windows/Styles/Resources.xamlsrc/Core/src/Platform/Windows/TextBoxExtensions.cssrc/Core/src/Platform/Windows/WebViewExtensions.cssrc/Core/src/Platform/iOS/ButtonExtensions.cssrc/Core/src/Platform/iOS/KeyboardAcceleratorExtensions.cssrc/Core/src/Platform/iOS/MauiPageControl.cssrc/Core/src/Platform/iOS/MauiScrollView.cssrc/Core/src/Platform/iOS/MauiSwipeView.cssrc/Core/src/Platform/iOS/MauiTextField.cssrc/Core/src/Platform/iOS/MauiTextView.cssrc/Core/src/Platform/iOS/MauiUIApplicationDelegate.Menu.cssrc/Core/src/Platform/iOS/MauiView.cssrc/Core/src/Platform/iOS/NoCaretField.cssrc/Core/src/Platform/iOS/PickerExtensions.cssrc/Core/src/Platform/iOS/SemanticExtensions.cssrc/Core/src/Platform/iOS/SliderExtensions.cssrc/Core/src/Platform/iOS/TabbedViewExtensions.cssrc/Core/src/Platform/iOS/TextFieldExtensions.cssrc/Core/src/PublicAPI/net-android/PublicAPI.Unshipped.txtsrc/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txtsrc/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txtsrc/Core/src/PublicAPI/net-windows/PublicAPI.Unshipped.txtsrc/Essentials/samples/Samples/View/ScreenshotPage.xamlsrc/Essentials/src/Browser/Browser.android.cssrc/Essentials/src/Clipboard/Clipboard.shared.cssrc/Essentials/src/DeviceDisplay/DeviceDisplay.ios.cssrc/Essentials/src/FilePicker/FilePicker.tizen.cssrc/Essentials/src/MediaPicker/MediaPicker.android.cssrc/Essentials/src/MediaPicker/MediaPicker.tizen.cssrc/Essentials/src/Platform/PlatformMethods.windows.cssrc/Essentials/src/Screenshot/Screenshot.android.cssrc/Essentials/src/TextToSpeech/TextToSpeech.ios.tvos.watchos.cssrc/Essentials/src/TextToSpeech/TextToSpeech.shared.cssrc/Essentials/src/TextToSpeech/TextToSpeech.windows.cssrc/Essentials/src/Types/Shared/WebUtils.shared.cssrc/SingleProject/Resizetizer/src/GenerateTizenManifest.cssrc/SingleProject/Resizetizer/src/SkiaSharpSvgTools.cssrc/SingleProject/Resizetizer/src/nuget/buildTransitive/Microsoft.Maui.Resizetizer.After.targetssrc/Templates/src/Microsoft.Maui.Templates.csprojsrc/Templates/src/templates/maui-mobile/MauiApp.1.csproj
New files (not reverted):
eng/devices/Run-PackagedAppAndWait.ps1src/Controls/src/Core/Platform/AlertManager/DelegateAlertSubscription.cssrc/Core/maps/src/Handlers/Map/MapElementPlatformOptions.Android.cssrc/Core/src/Platform/Android/AppbarLayoutExtensions.cssrc/Core/src/Platform/Android/IBackNavigationState.cssrc/Core/src/Platform/Android/RefreshViewWebViewScrollCapture.cssrc/Core/src/Platform/Windows/CharacterSpacingConverter.cssrc/Core/src/Platform/Windows/ContentPanelAutomationPeer.cssrc/Core/src/Platform/Windows/MauiBorderAutomationPeer.cssrc/Core/src/Platform/Windows/MauiLayoutAutomationPeer.cssrc/Core/src/Platform/iOS/MauiProgressView.cssrc/Templates/src/templates/maui-blazor-solution/.gitignoresrc/Templates/src/templates/maui-blazor/.gitignoresrc/Templates/src/templates/maui-lib/.gitignoresrc/Templates/src/templates/maui-mobile/.gitignoresrc/Templates/src/templates/maui-multiproject/.gitignore
UI Tests — Navigation,ViewBaseTests
Detected UI test categories: Navigation,ViewBaseTests
Pre-Flight — Context & Validation
Issue: #8680 - Rework OnBackButtonPressed to use onBackPressedDispatcher
PR: #35154 - [Android] Restore OnBackButtonPressed interception support when using OnBackPressedDispatcher
Platforms Affected: Android
Files Changed: 2 implementation, 2 test
Key Findings
- PR replaces the Android 13+
IOnBackInvokedCallbackpath and removes the deprecatedOnBackPressed()override, routing system back through an AndroidXOnBackPressedCallbackregistered withOnBackPressedDispatcher. - The added UI regression covers a pushed NavigationPage child whose
OnBackButtonPressed()returnstrueand asserts exactly one system back interception. - Existing prior inline feedback corrected the test to Android-only compilation and to use
App.Back()rather than the navigation bar back arrow. - GitHub CLI is unauthenticated in this environment, so PR metadata was gathered from the public GitHub API and local squashed review branch; CI checks were not queried directly.
- Gate was already completed before this task and failed; gate verification was not re-run and
gate/content.mdwas not modified.
Code Review Summary
Verdict: NEEDS_CHANGES
Confidence: high
Errors: 1 | Warnings: 0 | Suggestions: 0
Key code review findings:
- ❌
src/Core/src/Platform/Android/MauiAppCompatActivity.cs: the AndroidX callback is enabled only whenIBackNavigationState.CanConsumeBackNavigationis true. A root/single-pageContentPage.OnBackButtonPressed()override can still intentionally consume Android back, but with no modal or navigation stack entryCanConsumeBackNavigationis false, so the callback is disabled and the lifecycle handler is skipped. The added test only covers a pushed page and misses this regression.
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #35154 | Register lifecycle-aware AndroidX OnBackPressedCallback, enable it only when there is a lifecycle handler and MAUI navigation state can consume back, then fallback by temporarily disabling the callback and calling base.OnBackPressed(). |
❌ FAILED (Gate pre-run) | src/Core/src/Platform/Android/MauiAppCompatActivity.cs, src/Core/src/Platform/Android/MauiAppCompatActivity.Lifecycle.cs, UI test files |
Original PR; likely misses root-page interception. |
Code Review — Deep Analysis
Code Review — PR #35154
Independent Assessment
What this changes: Replaces the Android MauiAppCompatActivity.OnBackPressed() override / native API 33 callback path with an AndroidX OnBackPressedCallback, enabling/disabling it based on whether MAUI thinks in-app back navigation can be consumed. Adds an Android UI regression test for a pushed page whose OnBackButtonPressed() returns true.
Inferred motivation: Avoid duplicate back handling on Android 13+ while preserving MAUI page/lifecycle interception and Android predictive-back behavior.
Reconciliation with PR Narrative
Author claims: The PR fixes #8680 by unifying back handling on OnBackPressedDispatcher, eliminating API 33+ dual-fire behavior, and preserving predictive back-to-home animation when the app has nothing to handle.
Agreement/disagreement: The code matches the unification goal, but the narrative is stale in places (HandleBackNavigation() is still void, and OnDestroy still does manual callback cleanup). More importantly, the implementation appears to drop valid root-page OnBackButtonPressed() interception cases.
Findings
❌ Error — Root-page back interception can be skipped
src/Core/src/Platform/Android/MauiAppCompatActivity.cs:99 enables the dispatcher callback only when IBackNavigationState.CanConsumeBackNavigation is true. For a root ContentPage or a single-page NavigationPage whose current page overrides OnBackButtonPressed() and returns true to prevent app exit, Window.CanConsumeBackNavigation(...) returns false, so the AndroidX callback remains disabled and the MAUI lifecycle/page handler is never invoked. The added test only covers a pushed page (NavigationStack.Count > 1), so it misses this regression.
⚠️ Warning — Removing the shipped OnBackPressed() override is risky
src/Core/src/Platform/Android/MauiAppCompatActivity.Lifecycle.cs:132 removes the public obsolete override while src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt still contains override Microsoft.Maui.MauiAppCompatActivity.OnBackPressed() -> void. Even if AndroidX dispatch remains reachable through the base implementation in many cases, this is a public API/behavior compatibility change and should either keep a delegating obsolete override or be explicitly handled as an intentional API removal.
Devil's Advocate
The callback gating is trying to preserve Android's back-to-home preview, and keeping the callback always enabled may regress that animation. However, MAUI cannot infer whether arbitrary pages override OnBackButtonPressed() without invoking the existing handler path, and preserving the established interception contract is more important than silently exiting/backgrounding the app. I did not flag the base.OnBackPressed() fallback as an error because AndroidX ComponentActivity.OnBackPressed() itself dispatches through OnBackPressedDispatcher.
Verdict: NEEDS_CHANGES
Confidence: high
Summary: The PR addresses the duplicate-dispatch directionally, but it introduces a concrete regression where root/single-page OnBackButtonPressed() handlers no longer run. CI is also not green on the latest head (multiple maui-pr checks failed or were still running), so this is not ready as-is.
Fix — Analysis & Comparison
Fix Candidates
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| 1 | try-fix | Compatibility-first AndroidX bridge: keep shipped OnBackPressed(), replace API 33 native callback with AndroidX callback, enable when MAUI has a window/lifecycle handler. |
❌ FAIL / BLOCKED | 2 files | Avoids RS0017 but expert review found callback is effectively always enabled because MAUI registers a built-in handler, risking predictive back-to-home suppression. HostApp test blocked by unrelated Issue7814 compile error. |
| 2 | try-fix | Explicit back-consumer gating: add Controls state bridge for modal/nav/shell/flyout/root override and enable AndroidX callback only for known consumers. | ❌ FAIL | 5 files | Fails IL2075 trim analysis due reflection; expert review found lifecycle-only handlers, custom container overrides, and Shell root cancellation are skipped. |
| 3 | try-fix | Minimal duplicate-source removal: keep shipped OnBackPressed() and existing HandleBackNavigation(), remove only explicit Android 13+ native IOnBackInvokedCallback registration/unregistration/callback. |
1 file | Expert review clean; dotnet build src/Core/src/Core.csproj -f net10.0-android36.0 -c Debug passed. Full Android UI command blocked by unrelated HostApp Issue7814 compile error. |
|
| PR | PR #35154 | AndroidX dispatcher callback gated on lifecycle handler + CanConsumeBackNavigation, removes OnBackPressed(). |
❌ FAILED (Gate) | 4 files | Gate with fix fails RS0017 because shipped public OnBackPressed() override was removed; code review also found root-page interception gap. |
Cross-Pollination
| Model | Round | New Ideas? | Details |
|---|---|---|---|
| maui-expert-reviewer | 1 | Yes | Preserve OnBackPressed() but avoid using built-in lifecycle handler presence as a proxy for app-level back consumption. |
| maui-expert-reviewer | 2 | Yes | Avoid reflection/state prediction; preserve existing handler invocation and remove duplicate API 33 path instead. |
| maui-expert-reviewer | 3 | No | NO NEW IDEAS: attempt 3 is the best risk/reward path; AndroidX-gated approaches need predictive state MAUI cannot reliably know ahead of dispatch and reintroduce root/lifecycle/custom-container gaps. |
Exhausted: Yes
Selected Fix: Candidate #3 (provisional) — It is the only candidate with clean expert review and a passing focused Android Core build, and it directly addresses the duplicate-fire root cause while preserving shipped API and dynamic MAUI back handling. Full UI validation remains blocked by an unrelated HostApp baseline compile error in Issue7814.cs.
Report — Final Recommendation
Comparative Report — PR #35154
Winner: try-fix-3
Ranking
| Rank | Candidate | Regression result | Assessment |
|---|---|---|---|
| 1 | try-fix-3 |
Best candidate. It removes only the duplicate Android 13+ native callback while preserving the shipped obsolete OnBackPressed() override and existing dynamic MAUI back-handler invocation. Focused Android Core build passed, expert review found no issues, and the UI block was the unrelated HostApp Issue7814 baseline compile failure. |
|
| 2 | pr-plus-reviewer |
Not fully validated | Better than raw PR because reviewer feedback would preserve the shipped API, but applying the root-page feedback to the PR's AndroidX-gated approach still leaves an unsafe prediction problem: either root handlers are skipped or the callback is broadly enabled by MAUI's built-in lifecycle handler and predictive back-to-home can be suppressed. |
| 3 | pr |
❌ Gate failed | The submitted PR fix fails the supplied gate and has two major review findings: removal of shipped public MauiAppCompatActivity.OnBackPressed() and a root-page interception gap caused by CanConsumeBackNavigation gating. |
| 4 | try-fix-1 |
❌ Fail / blocked | Preserves OnBackPressed(), but expert review found the AndroidX callback becomes effectively always enabled in normal MAUI apps because of the built-in lifecycle handler, risking predictive back-to-home suppression. |
| 5 | try-fix-2 |
❌ Fail | Fails trim analysis (IL2075) and misses important dynamic handler cases such as lifecycle-only handlers, custom container overrides, and Shell root cancellation. |
Decision
Candidates that failed regression tests are ranked below candidates that passed or were only blocked by unrelated baseline issues. try-fix-3 wins because it is the only candidate with a clean expert review and passing focused Android build, while directly addressing the duplicate back-callback root cause without removing public API or attempting brittle predictive-state modeling.
The raw PR fix should not be used as submitted. pr-plus-reviewer is not selected because the reviewer feedback exposes a deeper flaw in the PR's design rather than a small patchable issue: MAUI cannot safely precompute every dynamic consumer of Android back using CanConsumeBackNavigation.
Future Action — alternative fix proposed (try-fix-3)
Automated review — alternative fix proposed
The expert-reviewer evaluation compared the PR fix against automatically generated candidates and selected try-fix-3 as the strongest fix.
Why: try-fix-3 is the only candidate with no expert-review findings and a passing focused Android Core build. It fixes the duplicate Android 13+ native callback problem while preserving the shipped OnBackPressed API and existing dynamic MAUI back handling; the remaining UI validation block is an unrelated HostApp baseline compile issue.
Please consider applying the candidate diff below (or use it as guidance). Once you push an update, this workflow will re-trigger and re-evaluate.
Candidate diff (try-fix-3)
diff --git a/src/Core/src/Platform/Android/MauiAppCompatActivity.cs b/src/Core/src/Platform/Android/MauiAppCompatActivity.cs
index aa9b9a210e..ab24a7c1ba 100644
--- a/src/Core/src/Platform/Android/MauiAppCompatActivity.cs
+++ b/src/Core/src/Platform/Android/MauiAppCompatActivity.cs
@@ -1,7 +1,5 @@
-using System;
using Android.OS;
using Android.Views;
-using Android.Window;
using AndroidX.Activity;
using AndroidX.AppCompat.App;
using AndroidX.Core.Content.Resources;
@@ -35,27 +33,10 @@ namespace Microsoft.Maui
this.CreatePlatformWindow(IPlatformApplication.Current.Application, savedInstanceState);
}
- // Register predictive back callback (Android 13+/API 33+) if available.
- // This integrates MAUI lifecycle OnBackPressed events with the system back gesture animation.
- // Guidance: route custom back handling through AndroidX OnBackPressedDispatcher so
- // predictive back works correctly:
- // https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture#update-custom
- if (OperatingSystem.IsAndroidVersionAtLeast(33) && _predictiveBackCallback is null)
- {
- _predictiveBackCallback = new PredictiveBackCallback(this);
- // Priority 0 = PRIORITY_DEFAULT: callback invoked only when no higher-priority callback handles the event
- OnBackInvokedDispatcher?.RegisterOnBackInvokedCallback(0, _predictiveBackCallback);
- }
}
protected override void OnDestroy()
{
- if (OperatingSystem.IsAndroidVersionAtLeast(33) && _predictiveBackCallback is not null)
- {
- OnBackInvokedDispatcher?.UnregisterOnBackInvokedCallback(_predictiveBackCallback);
- _predictiveBackCallback.Dispose();
- _predictiveBackCallback = null;
- }
base.OnDestroy();
}
@@ -75,21 +56,5 @@ namespace Microsoft.Maui
return handled || implHandled;
}
- PredictiveBackCallback? _predictiveBackCallback;
-
- sealed class PredictiveBackCallback : Java.Lang.Object, IOnBackInvokedCallback
- {
- readonly MauiAppCompatActivity _activity;
- public PredictiveBackCallback(MauiAppCompatActivity activity)
- {
- _activity = activity;
- }
-
- public void OnBackInvoked()
- {
- // Reuse unified handling (will invoke lifecycle events and conditionally propagate).
- _activity.HandleBackNavigation();
- }
- }
}
}
\ No newline at end of file
kubaflo
left a comment
There was a problem hiding this comment.
Could you check the ai's suggestions?
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
Fixes #8680
Replaces the deprecated
OnBackPressed()override and the API 33+-onlyPredictiveBackCallback(registered via nativeOnBackInvokedDispatcher) with a single unifiedMauiOnBackPressedCallbackregistered on AndroidXOnBackPressedDispatcher.What this fixes:
OnBackPressed()andPredictiveBackCallbackcould fireOnDestroycleanup —AddCallback(LifecycleOwner, callback)is lifecycle-awareWhat this does NOT change:
onBackStarted/onBackProgressed/onBackCancelled) are not surfaced to MAUI lifecycle — this was also the case before and could be a future enhancementChanges
MauiAppCompatActivity.cs— AddedMauiOnBackPressedCallback : OnBackPressedCallbackregistered inOnCreate; removedPredictiveBackCallback,using Android.Window, andusing SystemMauiAppCompatActivity.Lifecycle.cs— Removed deprecatedOnBackPressed()override; changedHandleBackNavigation()fromvoidtointernal boolKey Design Decisions
OnBackPressed()override?AppCompatActivity.OnBackPressed()internally callsOnBackPressedDispatcher.OnBackPressed()anyway. Once callbacks are registered with the dispatcher, the override is redundant and was creating a dual-path risk on API 33+.try/finallyaround the dispatcher call? When MAUI doesn't handle back, the callback temporarily disables itself and re-invokes the dispatcher, then re-enables infinally. Withoutfinally, an exception would leaveEnabled = falsepermanently.OnDestroycleanup?AddCallback(LifecycleOwner, callback)is lifecycle-aware — AndroidX removes the callback automatically atDESTROYED.